package demo1;
class Alg {
    public static <E extends Comparable<E>> E findMax (E[] array) {
        E max = array[0];
        for (int i = 0; i < array.length; i++) {
            if (max.compareTo(array[i]) < 0) {
                max = array[i];
            }
        }
        return max;
    }
}
public class Test2 {
    public static void main(String[] args) {
        Integer[] integer = new Integer[]{1,2,3,234,6};
        int max = Alg.findMax(integer);
        System.out.println(max);
    }
}
